package com.jiawa.wiki.controller;

import com.jiawa.wiki.domain.Student;
import com.jiawa.wiki.service.StudentService;
import org.slf4j.ILoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Argus
 * @className TestController
 * @description: TODO
 * @date 2025-06-12 11:43
 * @Version V1.0
 */
@RestController
//@Controller 返回一个页面
public class TestController {
    @Value("${test.hello:Test2}")
    private String testHello;

    @Autowired
    private StudentService studentService;

    @GetMapping("/hello")
    public String hello() {
        return "Hello World！"+testHello;
    }

    @GetMapping("/test/list")
    public List<Student> list () {
        return studentService.getStudentList();
    }
}